import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import http from './plugins/http'
import layout from './components/layout'
import VCharts from 'v-charts'


import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI)
Vue.use(VCharts)

Vue.prototype.$http = http

Vue.prototype.$checkPermission = function(permissionId){
  //用户的所有权限id数组里面如果包含传进来的id，说明这个用户有这个权限
  return store.state.user.permissionIds.includes(permissionId)
}

Vue.component('layout', layout)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
